package com.network.endity;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 文件存储
 */
@Entity
@Table(name = "file_save_t")
public final class FileSave
{
    public FileSave() {
    }
    public void setFileSave(FileSave fileSave)
    {
        this.equipmentName=fileSave.getEquipmentName();
        this.ip=fileSave.getIp();
        this.fileTypeName=fileSave.getFileTypeName();
        this.filePath=fileSave.getFilePath();
        this.fileSize=fileSave.getFileSize();
        this.fileSuffix=fileSave.getFileSuffix();
        this.fileName=fileSave.getFileName();
        this.changeNum=fileSave.getChangeNum();
        this.file_md5=fileSave.getFile_md5();
        this.fileStatus=fileSave.getFileStatus();
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 设备名称
     */
    @Column(name ="equipmentName")
    private String equipmentName;

    @Column(name = "ip")
    private String ip;
    /**
     * 备份文件 类型  系统数据  话单数据 用户数据 等等
     */
    @Column(name = "fileTypeName")
    private String fileTypeName;

    /**
     * '文件存储路径'
     */
    @Column(name = "filePath")
    private String filePath;
    /**
     * 文件大小
     */
    @Column(name = "fileSize")
    private String fileSize;

    /**
     * 文件后缀
     */
    @Column(name = "fileSuffix")
    private String fileSuffix;

    /**
     * 文件名称
     */
    @Column(name = "fileName")
    private String fileName;

    @Column(name = "changeNum")
    private Long changeNum;

    /**
     * 文件MD5值
     */
    @Column(name = "file_md5")
    private String file_md5;

    /**
     * 文件状态
     */
    @Column(name = "fileStatus")
    private int fileStatus;

    @Column(name = "createTime",columnDefinition="TIMESTAMP DEFAULT CURRENT_TIMESTAMP",insertable = false,updatable = false)
    @Generated(GenerationTime.INSERT)
    private Timestamp createTime;

    @Column(name = "updateTime",insertable = false,updatable = false)
    @Generated(GenerationTime.INSERT)
    private Timestamp updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEquipmentName() {
        return equipmentName;
    }

    public void setEquipmentName(String equipmentName) {
        this.equipmentName = equipmentName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getFileTypeName() {
        return fileTypeName;
    }

    public void setFileTypeName(String fileTypeName) {
        this.fileTypeName = fileTypeName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getFileSize() {
        return fileSize;
    }

    public void setFileSize(String fileSize) {
        this.fileSize = fileSize;
    }

    public String getFileSuffix() {
        return fileSuffix;
    }

    public void setFileSuffix(String fileSuffix) {
        this.fileSuffix = fileSuffix;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Long getChangeNum() {
        return changeNum;
    }

    public void setChangeNum(Long changeNum) {
        this.changeNum = changeNum;
    }

    public String getFile_md5() {
        return file_md5;
    }

    public void setFile_md5(String file_md5) {
        this.file_md5 = file_md5;
    }

    public int getFileStatus() {
        return fileStatus;
    }

    public void setFileStatus(int fileStatus) {
        this.fileStatus = fileStatus;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }
}
